package dq.study.designmodel.filter;

/**
 * @author dongqun
 * @Description:
 * @date 2019/3/9 16:03
 */
public class Test {

    public static void main(String[] args) {
        Request request = new Request();
        //会中断责任链
        request.setRequest("<大保健里搞个小内内> 我是你的小星星");
        // 执行完整责任链
//        request.setRequest("<大保健里搞个小内内> 我是你的小晶晶");
        Response response = new Response();
        response.setResponse("---<<");
        FilterChain fc = new FilterChain();
        fc.addFilter(new MyFilter1())
                .addFilter(new MyFilter2())
                .addFilter(new MyFilter3())
                .doFilter(request, response);
        System.out.println(request.getRequest());
        System.out.println(response.getResponse());
    }

}
